# -*- coding: utf-8 -*-
'''
    :file: __init__.py
    :author: -Farmer
    :url: https://blog.farmer233.top
    :date: 2021/03/31 10:37:52
'''

from flask import current_app


@current_app.before_first_request
def before_first_request():
    print("这是before_first_request钩子函数！")
    
@current_app.before_request
def before_request():
    print("这是before_request钩子函数！")
    
@current_app.after_request
def after_request(response):
    print("这是after_request钩子函数！")
    response.headers["Content-Type"] = "application/json"
    return response
​
@current_app.teardown_request
def teardown_request(e):
    print("这是teardown_request钩子函数！")